import React from 'react';
import { List } from 'antd';

const bookNamesList: string[] = [
  '文山集',
  '登科录',
  '指南录',
  '指南后录',
  '过零丁洋',
  '正气歌',
  '文山先生全集',
  '白鹭洲书院志',
];

const RightBar: React.FC<{
  findBookName: (bookName: string) => void;
}> = (props: { findBookName: (bookName: string) => void }) => {
  return (
    <>
      <div>
        <List
          size="large"
          header={<h3>热门文献</h3>}
          bordered
          dataSource={bookNamesList}
          renderItem={(item: string) => (
            <List.Item>
              <>
                <a
                  onClick={() => {
                    // console.log(item);
                    props.findBookName(item);
                  }}
                  defaultChecked={false}
                >
                  {item}
                </a>
              </>
            </List.Item>
          )}
        />
      </div>
    </>
  );
};

export default RightBar;
